Skip to content

global-ctx: add nvme_sysfs_ctrl_path() for mockable sysfs paths - #4047

Merged
igaw merged 1 commit into
linux-nvme:masterfrom
Micron-TPG-OSS:bgoing/nvme-cli-mockable-sys-paths
Sep 22, 2026
Merged

igaw merged 1 commit into
linux-nvme:masterfrom
Micron-TPG-OSS:bgoing/nvme-cli-mockable-sys-paths

Conversation

@brgoing

@brgoing brgoing commented Sep 18, 2026

Copy link
Copy Markdown
Collaborator

nvme-cli code that reads controller sysfs attributes directly (rather than through libnvme) hardcoded "/sys/class/nvme/", so it could not be redirected under --set-options test-sysfs-dir= the way libnvme itself can. Add nvme_sysfs_ctrl_path() to mirror libnvme's test sysfs root and use it in the Micron PCIe BDF lookup and the PCI-IDs sysfs lookup.

Comment thread src/global-ctx.c Outdated
@brgoing
brgoing force-pushed the bgoing/nvme-cli-mockable-sys-paths branch from b79e3a9 to a359b47 Compare September 21, 2026 13:59
nvme-cli code that reads controller sysfs attributes directly (rather
than through libnvme) hardcoded "/sys/class/nvme/<ctrl>", so it could
not be redirected under --set-options test-sysfs-dir= the way libnvme
itself can. Add nvme_sysfs_ctrl_path() to mirror libnvme's test sysfs
root and use it in the Micron PCIe BDF lookup and the PCI-IDs sysfs
lookup.

Signed-off-by: Broc Going <bgoing@micron.com>
@igaw
igaw merged commit 3d87485 into linux-nvme:master Sep 22, 2026
32 checks passed
@igaw

igaw commented Sep 22, 2026

Copy link
Copy Markdown
Collaborator

Thanks!

@brgoing
brgoing deleted the bgoing/nvme-cli-mockable-sys-paths branch September 22, 2026 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants